<?php
//~ header('Content-Type: text/xml');
include "fonctions.php";

if (isset($_POST['id'])) {
		db_connect();
		$req_cad ="SELECT ph.partieVisible, ph.partieCache, exo.nom, cad.vitrine
		FROM LMLP.exercices as exo, LMLP.cadavre_exquis as cad, LMLP.phrases as ph 
		WHERE cad.idExercice=".$_POST['id']." 
		and cad.idExercice=ph.idCadavreExcquis 
		and cad.idExercice=exo.idExercice;";
		$result  = mysql_query($req_cad) or die (mysql_error());
		$text="";
		$test= true;
		while ($row = mysql_fetch_assoc($result)) {
			if($test){
				echo $row['vitrine']."#";
				echo $row['nom']."#";
				
				$test=false;
			}
			$text=$text."<p>".$row['partieCache']." ".$row['partieVisible']."</p>\n";
		}
		
		$req = "UPDATE LMLP.exercices SET etat = 'archive' WHERE idExercice=".$_POST['id'].";";
		$res  = mysql_query($req) or die (mysql_error());

}
?>
